* ===================================================================================================
* Thürk/Klüver: Hitting the sweet spot? The electoral consequences of supporting minority governments
*
* Comparative Political Studies
*  
* Replication Do File for causal mechanisms (Tables 17, Figures 10 and 11)
* ===================================================================================================

* set working directory
clear
cd "..." 
set more off
* open dataset
use "...\casestudySweden_ThuerkKluever.dta", clear

*** Model 89: 
didregress (identifiers_s overall dists_rile) (treatment), group(party_id) time(year)
estimates store m89
** Figure 10: parallel trends assumption met
estat ptrends
estat trendplot

*** Model 90
didregress (identifiers_m overall distm_rile) (treatment) if party_id<4, group(party_id) time(year)
estimates store m90
** Figure 11: parallel trends assumption not met
estat ptrends
estat trendplot

* All results for table 17
esttab m89 m90,  b(%9.3f) se(%9.3f) r2(2) label title(Diff-in-Diff Results) nonumbers mtitles("S" "M" "Rile S" "Rile M") star(* 0.1 ** 0.05 *** 0.01)  parentheses replace
esttab m89 m90 using results.tex, b(%9.3f) se(%9.3f) r2(2) label title(Diff-in-Diff Results) nonumbers mtitles("S" "M" "Rile S" "Rile M") star(* 0.1 ** 0.05 *** 0.01)  parentheses replace

************************************  
************* Figure 6 ************* 
************************************ 
set scheme plottig
coefplot (m89, levels(95 90) label("Becoming contract support party (treatment) by Social democrats' supporters") ///
            msymbol(O) lcolor(black) msize(large) ciopts(lpattern(solid))) ///
         (m90, levels(95 90) label("Becoming contract support party (treatment) by Moderate Party supporters") ///
            msymbol(S) mcolor(gs6) lcolor(gs6) msize(large) ///
            ciopts(lcolor(gs6) lpattern(solid))), ///
         vertical yline(0, lpattern(dash) lcolor(red)) ///
         legend(position(6) ) ///
         ytitle("") ///
         xtitle("ATE of treatment vs. control", size(mediumlarge)) ///
         xlabel("") ///
         ylabel(-2(1)2, grid)
		 




























